<%--
  Created by IntelliJ IDEA.
  User: imac
  Date: 2020/7/28
  Time: 6:00 下午
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--如果想要获取到request中保存的list集合并遍历输出，要使用第三方提供的标签库--%>
<%--引用标签库--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<html>
<head>
    <title>Title</title>
    <!-- Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
    用户名：${sessionScope.username}
    <table class="table table-hover">
        <tr>
            <td>id</td>
            <td>name</td>
            <td>phone</td>
            <td>email</td>
            <td>title</td>
            <td>content</td>
            <td>createdtime</td>
            <td>操作</td>
        </tr>

        <%--       <%--%>
        <%--         String path = request.getContextPath();--%>
        <%--         request.setAttribute("path",path);--%>
        <%--       %>--%>
        <c:forEach var="gb" items="${sessionScope.list}" varStatus="status">
            <tr>
                <td>${status.index+1}</td>
                <td>${gb.name}</td>
                <td>${gb.phone}</td>
                <td>${gb.email}</td>
                <td>${gb.title}</td>
                <td>${gb.content}</td>
                <td>${gb.createdtime}</td>
                <td>
                    <a href="<%=request.getContextPath()%>/Update.jsp?id=${gb.id}&name=${gb.name}&phone=${gb.phone}&email=${gb.email}" class="btn btn-primary">修改</a>
                    <a href="<%=request.getContextPath()%>/user/manager?id=${gb.id}&q=delete" class="btn btn-danger">删除</a>
                </td>
            </tr>
        </c:forEach>
    </table>
</div>


</body>
</html>